import { CreatePermMenuDto, UpdatePermMenuDto } from '@ai/entity';
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common';
import { Public } from '@/utils/metadata/public';
import { PermMenuService } from './perm-menu.service';

@Public()
@Controller('perm-menu')
export class PermMenuController {
    constructor(private readonly permMenuService: PermMenuService) {}

    @Post()
    create(@Body() createPermMenuDto: CreatePermMenuDto) {
        return this.permMenuService.create(createPermMenuDto);
    }

    @Get('list')
    findAll() {
        return this.permMenuService.findAll();
    }

    @Get(':id')
    findOne(@Param('id') id: string) {
        return this.permMenuService.findOne(id);
    }

    @Patch(':id')
    update(@Param('id') id: string, @Body() updatePermMenuDto: UpdatePermMenuDto) {
        return this.permMenuService.update(id, updatePermMenuDto);
    }

    @Delete(':id')
    remove(@Param('id') id: string) {
        return this.permMenuService.remove(id);
    }
}
